﻿<?php

/***

LZRoster: A roster for World of Warcraft.
Copyright (C) 2007  Emmanuel Cron

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

***/

require_once dirname(__FILE__)."/../univ-class/class/CharacterSortMethod.class.php";

$array = array (
	'sortname' => new CharacterSortMethod(
		"sortname",
		"by name",
		"characters/sortname.gif",
		"characters/sortname_big.gif",
		"GROUP BY `Name`",
		null
		
	),
	'sortrace' => new CharacterSortMethod(
		"sortrace",
		"by race",
		"characters/sortrace.gif",
		"characters/sortrace_big.gif",
		"GROUP BY `RaceEn`, `Name`",
		"RaceEn",
		CHARACTER_SORT_METHOD_USES_RACE
	),
	'sortclass' => new CharacterSortMethod(
		"sortclass",
		"by class",
		"characters/sortclass.gif",
		"characters/sortclass_big.gif",
		"GROUP BY `ClassEn`, `Name`",
		"ClassEn",
		CHARACTER_SORT_METHOD_USES_CLASS
	),
	'sortprofession' => new CharacterSortMethod(
		"sortprofession",
		"by profession",
		"characters/sortprofession.gif",
		"characters/sortprofession_big.gif",
		"GROUP BY `Name`",
		"Professions",
		CHARACTER_SORT_METHOD_USES_PROFESSION
	),
	'sortguildrank' => new CharacterSortMethod(
		"sortguildrank",
		"by guild rank",
		"characters/sortguildrank.gif",
		"characters/sortguildrank_big.gif",
		"GROUP BY `GuildRank` ASC, `Name` ASC",
		"GuildTitle"
	),
	'sortlevel' => new CharacterSortMethod(
		"sortlevel",
		"by level",
		"characters/sortlevel.gif",
		"characters/sortlevel_big.gif",
		"GROUP BY `Level` DESC, `Name`",
		"Level",
		CHARACTER_SORT_METHOD_USES_LEVEL
	),
	'sortupdate' => new CharacterSortMethod(
		"sortupdate",
		"by last update date",
		"characters/sortupdate.gif",
		"characters/sortupdate_big.gif",
		"GROUP BY `timestampUpdate` DESC",
		null
	),
	'sortaccount' => new CharacterSortMethod(
		"sortaccount",
		"by account",
		"characters/sortaccount.gif",
		"characters/sortaccount_big.gif",
		"GROUP BY `GuildRank` ASC, `Name`",
		"account_nickname"
	),
);

if (file_put_contents( dirname(__FILE__)."/../univ-class/class.data/CharacterSortMethodContainer.sort_methods.serialize", serialize($array) ) != FALSE) {
	echo "SUCESS";
} else {
	echo "FAILED";
}

?>